#ifndef LOCALLISTWIDGET_H
#define LOCALLISTWIDGET_H

#include <QWidget>
#include "songitemwidget.h"
#include <vector>
#include <string>

namespace Ui {
class LocalListWidget;
}

class LocalListWidget : public QWidget
{
    Q_OBJECT

public:
    explicit LocalListWidget(QWidget *parent = nullptr);
    ~LocalListWidget();
    void flush();
private:
    bool eventFilter(QObject *watched, QEvent *event);
    void addSongItem(SongItemWidget *songItem);
    void on_songItem_played(int index, bool play);
private slots:
    void on_pushButton_playAll_clicked();
    void on_pushButton_clicked();

    void on_pushButton_download_clicked();
signals:
    void played(SongItem songItem, bool play);
    void playAll(const QVector<QUrl>& songs);

private:
    QVector<SongItemWidget*> _songItems;
    QStringList _selectedPaths; // 我觉得,保存选择的文件夹就行--网易云的有点挫了,选了还不能删
    Ui::LocalListWidget *ui;
};

#endif // LOCALLISTWIDGET_H
